package com.example.allexception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class AllException {
    @ExceptionHandler(value=Exception.class)
    @ResponseBody
    public String exception(Exception e){
        return "处理错误！";
    }
}